import { axios } from '@/utils/request'
export function getAllDepartmentData(parentOrgId) {
  return axios({
    url: '/sys/hr/admin/org/listOrganizationByParentId?parentOrgId='+parentOrgId,
      method: 'get',
  })
}
export function getAllDepartmentTree(parentOrgId) {
  return axios({
    url: '/sys/hr/admin/org/selectAdminOrgTree?parentOrgId='+parentOrgId,
      method: 'get',
  })
}
export function getAllOrgList(parameter) {
  return axios({
    url: '/sys/hr/admin/staff/getAllStaffAndOrgList',
    method: 'get',
    params: parameter
  })
}
export function getOrgLists(parameter) {
  return axios({
    url: '/sys/hr/admin/org/orgStaffTree',
    method: 'post',
    data: parameter
  })
}
export function getDepartmentPage(parameter) {
  parameter.pageNum = parameter.current;
  parameter.pageSize = parameter.size;
  return axios({
    url: '/sys/hr/admin/org/pageQueryOrganizationByParentOrgId',
    method: 'get',
    params:parameter
  })
}
export function addDepartment(parameter) {
  return axios({
    url: '/sys/hr/admin/org/add',
    method: 'post',
    data:parameter
  })
}
export function editDepartment(parameter) {
  return axios({
    url: '/sys/hr/admin/org/update',
    method: 'post',
    data:parameter
  })
}
export function delDepartment(parameter) {
  return axios({
    url: '/sys/hr/admin/org/delete',
    method: 'post',
    data:parameter
  })
}

export function enableDepartment(parameter) {
  return axios({
    url: '/sys/hr/admin/org/disOrEnableAdminOrganization',
    method: 'post',
    data:parameter
  })
}
export function getListEnterprise(parameter) {
  return axios({
    url: '/sys/hr/enterprise/listEnterprise',
    method: 'get',
    params: parameter
  })
}